package 高级Java;

import java.io.File;

public class 上传2 {  
  
    /**  
     * @param args  
     */   
    public static void main(String[] args) {   
        // TODO 自动生成方法存根   
        File f=new File("D:/old.txt");   
        String c=f.getParent(); 
        

		  
		  
        File mm=new File(c+File.pathSeparator+"new.txt");   
        if(f.renameTo(mm))   
        {   
        System.out.println("修改成功!");   
        }   
        else   
        {   
        System.out.println("修改失败");   
        }  
  
    } 
    class User{
    	public void add(){
        String clazz = this.getClass().getName(); 
		 String method = Thread.currentThread() .getStackTrace()[1].getMethodName(); 
		 System.out.println("class name: " + clazz + " Method Name " + method);  
    	}
    }
  
}  